=========================================================================== BBS: The Abacus * HST/DS * Potterville, MI Date: 04-26-93 (16:39) Number: 75 From: CALVIN FRENCH Refer#: NONE To: ALL Recvd: NO Subj: LCOUNT.BAS useful utilit Conf: (35) Quick Basi --------------------------------------------------------------------------- Hello All! Here's a SIMPLE little program that I wrote it's certainly nothing any of you guys couldn't have written but I thought i'd spare you the time and post it anyways. Well, it just counts up all the lines, commented lines, etc in the program and outputs the information to a file (if you like) so you can keep track. It's really simple I just thought someone would like to have a look and use it like i do. It's really pretty useful. ___------------------- Cut Here ----------------------------- INPUT "File to read? ", f$ CLS DEFINT A-Z OPEN f$ FOR INPUT AS #1 DO WHILE NOT EOF(1) LOCATE 1, 1 lin& = lin& + 1 PRINT "Reading Line: "; lin& LINE INPUT #1, a$ IF LEFT$(a$, 1) <> "'" AND LEFT$(a$, 1) <> "REM" THEN code& = code& + 1 IF INSTR(a$, "'") > 0 OR INSTR(a$, "REM") > 0 THEN clin& = clin& + 1 char& = char& + LEN(a$) LOOP PRINT "------------------------------------" PRINT "lines: "; lin& PRINT "pages: "; lin& / 24 PRINT "printer pages (by 80s): "; lin& / 80 PRINT "chars: "; char& PRINT "bytes: "; LOF(1) PRINT "lines with code: "; code& PRINT "commented lines: "; clin& PRINT "------------------------------------" PRINT "-RAW- Source code "; lin& - clin& PRINT "Output to file?"; a$ = INPUT$(1) IF UCASE$(a$) = "Y" THEN PRINT " Yes!" OPEN "BASDAT.TXT" FOR APPEND AS #2 PRINT #2, "File Data for "; f$; " as of "; DATE$ PRINT #2, "------------------------------------" PRINT #2, "lines: "; lin& PRINT #2, "pages: "; lin& / 24 PRINT #2, "printer pages (by 80s): "; lin& / 80 PRINT #2, "chars: "; char& PRINT #2, "bytes: "; LOF(1) PRINT #2, "lines with code: "; code& PRINT #2, "commented lines: "; clin& PRINT #2, "------------------------------------" PRINT #2, "-RAW- Source code "; lin& - clin& PRINT #2, "" CLOSE END END IF PRINT " No!" END ------------------------------------------------[here]--------------- BTW Here's the LCOUNT specs for C-TD20 so far to give you an idea of how it work s: File Data for c-td45t.bas as of 04-25-1993 ------------------------------------ lines: 2983 pages: 124.2916666666667 printer pages (by 80s): 37.2875 chars: 64547 bytes: 70513 lines with code: 2575 commented lines: 510 ------------------------------------ -RAW- Source Code: 2473 ... OFFLINE 1.52 "REAL programmers cross-develop on a GE toaster." --- Maximus 2.01wb * Origin: RJ's Byteline =[HST/DS]= Calgary (403)247-3180 CANADA (1:134/75) SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1 SEEN-BY: 153/752 154/40 77 157/2 159/100 125 430 575 950 203/23 209/209 SEEN-BY: 280/1 390/1 396/1 15 397/2 2230/100 2440/5 3603/20